⚡ Bolt: [성능 최적화] 정적 에셋 객체 분리 - #270
Conversation
`process_dir` 루프 내부에서 발생하는 불필요한 큰 문자열 할당 및 SHA-256 해시 계산을 단 한 번만 실행되도록 `StaticAssets` 객체로 추출했습니다.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
This PR refactors process_dir in the Kotlin CLI to avoid repeating static asset construction work during directory traversal, by extracting the CSS payload and its SHA-256 CSP hash into a single reusable object.
Changes:
- Extracted the large inline CSS string and its CSP hash (
styleHash) into aprivate object StaticAssets. - Updated
process_dirto referenceStaticAssets.styleHashandStaticAssets.cssinstead of recomputing them per directory. - Added a new performance learning entry to
.jules/bolt.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/kotlin/html4tree/main.kt | Moves inline CSS + SHA-256 hash computation into a reusable static holder and updates CSP/CSS emission to reference it. |
| .jules/bolt.md | Documents the optimization as a new “Bolt” learning/action entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const val css = """ | ||
| <style> | ||
| ${cssContent} </style> | ||
| """ |
|
Closing as superseded by canonical #363. The same static-assets extraction is implemented there together with exact CSP source-byte matching, an independent generated-page digest test, APA 7 doctoring, changelog, and fresh exact-head CI/JaCoCo/Security/Semgrep evidence. No evidence from this duplicate head is reused. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
💡 What:
process_dir함수 내에서 매번 생성되던 큰 문자열(cssContent,css)과 정적 계산(styleHash)을private object StaticAssets로 추출했습니다.🎯 Why: 디렉토리 순회 과정에서 동일한 문자열과 해시 값을 반복적으로 할당하고 계산하는 것은 불필요한 메모리 및 CPU 오버헤드를 유발하기 때문입니다.
📊 Impact: 디렉토리마다 발생하던 문자열 객체 생성 및 SHA-256 해시 계산을 단 한 번만 실행하여 I/O 루프 내의 성능과 리소스 사용을 최적화했습니다.
🔬 Measurement:
./gradlew test jacocoTestReport jacocoTestCoverageVerification를 실행하여 기능 정상 작동 및 100% 테스트 커버리지를 확인했습니다.PR created automatically by Jules for task 7121890314610214293 started by @seonghobae